package org.example;


import lombok.Getter;
import lombok.Setter;

/**
 * @author chenbing
 * @date 2021-06-10
 */

public enum Day {
    MON("周一"),
    THU("周二"),
    WED("周三"),
    TUE("周四"),
    FRI("周五"),
    SAT("周六"),
    SUN("周天");


    @Getter
    @Setter
    private String name;

    Day(String name) {
        this.name = name;
    }

    public static Day getByName(String name) {
        if (null == name) {
            return null;
        }
        for (Day day : Day.values()) {
            if (day.getName().equals(name)) {
                return day;
            }
        }
        return null;
    }
}
